<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    protected $rule =   [
        'nickname'      => 'require|min:2|max:40',
        'email'         => 'require|email',
        'mobile'        => ['require'],
        'password'      => ['min' => 6,'max' => 40],
    ];
    protected $message  =   [
        'nickname.require' => '请输入昵称',
        'nickname.min'     => '昵称长度不能小于2位',
        'nickname.max'     => '昵称长度不能大于40位',
        'email.require'    => '请填写邮箱号',
        'email.email'      => '邮箱号格式错误',
        'mobile.require'   => '请输入手机号',
        'password.min'     => '登录密码长度不能小于6位',
        'password.max'     => '登录密码长度不能大于40位',
    ];
    protected $scene = [
        'save'          => ['nickname','email','mobile','password'],
        'update'        => ['nickname'],
    ];
}